package FirstHomeworks;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.annotations.Test;

import java.util.concurrent.TimeUnit;

/**
 * Created with IntelliJ IDEA.
 * User: admin
 * Date: 17.03.14
 * Time: 21:26
 * To change this template use File | Settings | File Templates.
 */
public class Lesson4 {

    @Test
    public void test1() throws InterruptedException{
    WebDriver driver = new FirefoxDriver();
        driver.get("http://www.ukr.net");

        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

        WebElement myElement = (new WebDriverWait(driver, 10))
                .until(ExpectedConditions.presenceOfElementLocated(By.id("link")));

        driver.findElement(By.id("link")).click();

        Thread.sleep(5000);
        driver.quit();
    }
}
